package com.xx.util;

import javafx.scene.image.ImageView;

import java.util.Objects;


public class Util {
    public static String getResourceUrl(String path) {
        return Objects.requireNonNull(Util.class.getResource(path)).toExternalForm();
    }
    public static ImageView getImageView(double fillWidth,String path){
        ImageView imageView = new ImageView(getResourceUrl(path));
        imageView.setPreserveRatio(true);
        imageView.setFitWidth(fillWidth);
        return imageView;
    }
}
